__author__ = 'zhenjiao.su'
#-*- coding: utf-8 -*-
import Other
from selenium.webdriver.support.wait import WebDriverWait
class payserver():
    def __init__(self,driver):
        self.driver=driver
    def payserverexit(self):    #判断是否进入支付中心，以前端是否显示“收银台”
        try:
            WebDriverWait(self.driver,10).until(lambda a:a.find_element_by_css_selector(".e_header_title"))
            return True
        except:
            return False
    def payserverresults(self):     #获取支付中心相关信息
        self.paymomey=self.driver.find_element_by_css_selector("#pay_count_detail .price_change").text  #支付金额
        self.driver.find_element_by_class_name("show").click()
        peoplecount=self.driver.find_element_by_css_selector(".order_sub_name_details td:nth-child(1)").text  #出行人数
        peoplecount=peoplecount.encode("utf-8")
        self.peoplecounts=Other.splittext(peoplecount,1,"：")
        messagepeople=self.driver.find_element_by_css_selector(".order_sub_name_details td:nth-child(2)").text #联系人
        messagepeople=messagepeople.encode("utf-8")
        self.messagepeoples=Other.splittext(messagepeople,1,"：")
        payhotelname=self.driver.find_element_by_css_selector("#detail_more_ctn_box>div>div>div:nth-child(3)>span").text  #酒店名称
        payhotelname=payhotelname.encode("utf-8")
        self.payhotelname=Other.splittext(payhotelname,1,"：")
